package org.xyl.game.entity;

import lombok.Data;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Data
@Table(name="mygame")

public class Mygame {

    private Integer roomid;
    private String username;
    private Integer mycount;
    private String result;

    @Basic
    @Id
    @Column(name = "roomid")
    public Integer getRoomid() {
        return roomid;
    }

    public void setRoomid(Integer roomid) {
        this.roomid = roomid;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "mycount")
    public Integer getMycount() {
        return mycount;
    }

    public void setMycount(Integer mycount) {
        this.mycount = mycount;
    }

    @Basic
    @Column(name = "result")
    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Mygame mygame = (Mygame) o;
        return Objects.equals(roomid, mygame.roomid) && Objects.equals(username, mygame.username) && Objects.equals(mycount, mygame.mycount) && Objects.equals(result, mygame.result);
    }

    @Override
    public int hashCode() {
        return Objects.hash(roomid, username, mycount, result);
    }
}
